package com.mstanford.movie.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mstanford.movie.dao.MovieDao;
import com.mstanford.movie.utils.DataUtil;

public class SeePwdServlet extends HttpServlet  {

	private static final long serialVersionUID = 1L;
	protected void service(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{
		res.setCharacterEncoding("utf-8");
		
		String memberId = req.getParameter("memberId");
		MovieDao dao = new MovieDao();
		Map<String, String> map = new HashMap<String, String>();
		map = dao.queryMemberPhoto(memberId);
		String json = DataUtil.mapToJson(map);
		res.setContentType("application/json; charset=UTF-8");
		PrintWriter out = res.getWriter();
		out.print(json);
		out.flush();
		out.close();
	}
}
